Program:	Fraction
Author:		Rob Gaebler
Date:		1/14/02

FRACTION is the combination of four different programs having to do with
fractions (rational numbers).  When you run FRACTION, a menu pops up with these
four options:
1:Approximation
2:Unit decomp
3:Exact decimal
4:Continued frac

Approximation: This program gives increasingly more accurate rational
approximations to any positive real number.  First input the number you want to
approximate, then enter the maximum allowable error for an approximation.  The
program will find better and better approximations until the error is less than
the allowable error.  The program displays the rational approximations as
ordered pairs.  Each pair represents a fraction, with the first element the
numerator and the second element the denominator.   The number in the lower
left displays the progress of the search so far.  The number in the lower right
displays the error of the last fraction so far.

Unit decomp: Breaks down a rational number into the sum of unit fractions
(fractions whose numerator is 1).  The program can find all decompositions into
2 or fewer, 3 or fewer, or 4 or fewer unit fractions.  The program outputs
several lists of length 2, 3, or 4, which represent the denominators of the
unit fractions.  For example, if you enter the fraction 5/6, into 3 or fewer
fractions, the output lists are {2 3}, {2 4 12}, {2 6 6}, {3 3 3}, and {3 4 4}.
Thus 1/2+1/4+1/12=5/6.  This program finds ALL possible decompositions into the
specified number of unit fractions.

Exact decimal: Finds the exact decimal representation of a rational number.  If
the digits repeat periodically starting at the first digit after the decimal
point, the program determines what the repeating digits are.  The integer part
of the input is ignored.  The output is a string of digits down the right side
of the screen; these are all the digits starting after the decimal point.  If
the digits do not repeat, you must interrupt by pressing ON.

Continued frac: Expresses a real number as a continued fraction.  A continued
fraction is a number expressed in the form a0+1/(a1+1/(a2+1/(a3+....  The
program prompts for the number to express as a continued fraction, and the
maximum number of terms in the expansion.  The output is the list of numbers
a0, a1, a2, ....  If the input number is a rational number, the list will
terminate, but not otherwise.

Feel free to contact me with questions or comments at rgaebler@hmc.edu.


